import request from '@/utils/request';

/**
 * 获取近期互动
 * @param {Number} showCount //
 * @param {Number} currentPage
 */
export const getRecentActivityInfo = ({ showCount, currentPage }) => {
  return request.post('/newHuoDongHm/latelyHuoDongList', {
    // type: '5',
    // showCount,
    // currentPage,
    type: '5',
    showCount,
    currentPage,
  });
};

/**
 * 获取互动
 * @param {Number} showCount
 * @param {Number} currentPage
 * @param {Number} type
 *
 */
export const getActivityInfo = ({ showCount, currentPage, type, request_from_page = 'api/app/live' }) => {
  return request.post('/newHuoDongHm/liebiao', {
    // request_from_page,
    // type, // 2 进行中活动 1 已完成活动
    // scene_type: '', // 0 婚礼 1 企业
    // showCount: showCount.toString(),
    // currentPage: currentPage.toString(),
    request_from_page,
    type, // 2 进行中活动 1 已完成活动
    scenario: '', // 0 婚礼 1 企业
    showCount: showCount.toString(),
    currentPage: currentPage.toString(),
  });
};

/**
 * 获取进行中互动
 * @param {Number} showCount
 * @param {Number} currentPage
 */
export const getProcessingActivityInfo = ({ showCount, currentPage }) => {
  return request.post('/newHuoDongHm/liebiao', {
    // type: '2', // 进行中活动
    // scene_type: '', // 0 婚礼 1 企业
    // showCount: showCount.toString(),
    // currentPage: currentPage.toString(),
    type: '2', // 2 进行中活动 1 已完成活动
    scenario: '', // 0 婚礼 1 企业
    showCount: showCount.toString(),
    currentPage: currentPage.toString(),
  });
};

/**
 * 获取已完成互动
 * @param {Number} showCount //
 * @param {Number} currentPage
 */
export const getCompleteActivityInfo = ({ showCount, currentPage }) => {
  return request.post('/newHuoDongHm/liebiao', {
    type: '1', // 已完成活动
    showCount,
    currentPage,
  });
};

/**
 * 创建互动
 */
export const createActivity = ({ theme, bar_logo, hotel_name, scenario, wife_mima, bar_notice }) => {
  return request.post('/huoDongHm/add', {
    theme,
    bar_logo,
    hotel_name,
    scenario,
    wife_mima,
    bar_notice,
  });
};
